package business.validation;

public class ValidationException extends RuntimeException {	
	private static final long serialVersionUID = 1L;
	
	public ValidationException(String msg) {
		super(msg);
	}
	
	public ValidationException(String msg, Throwable cause) {
		super(msg, cause);
	}
	
	/* partially taken from 
	 * http://download.oracle.com/javase/tutorial/essential/exceptions/chained.html
	 * */
	@Override
	public void printStackTrace() {
		StackTraceElement elements[] = getCause().getStackTrace();
		for (StackTraceElement element : elements) {
			System.out.println(element.getFileName() + ":" 
                    + element.getLineNumber() 
                    + ">> " 
                    + element.getMethodName() + "()");
		}
		getCause().printStackTrace();
	}
}
